package com.atguigu.gulimall.search.feign;

import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @title: ProductFeignService
 * @Author syh
 * @Date: 2022/6/30 16:41
 * @Version 1.0
 */

@FeignClient("gulimall-product")
public interface ProductFeignService {

    /**
     * 根据attrId获取商品属性信息
     *
     * @param attrId
     * @return
     */
    @RequestMapping("/product/attr/info/{attrId}")
    R getAttrInfo(@PathVariable("attrId") Long attrId);

    /**
     * 根据传入品牌id获取所有品牌信息
     *
     * @param brandIds
     * @return
     */
    @GetMapping("/product/brand/infos")
    public R brandsInfo(@RequestParam("brandIds") List<Long> brandIds);
}
